<template>
  <AbsurdVirtualTable :data="list" :height="32">
    <template v-slot="{ row }">
      <div>{{ row.id }}</div>
      <div>{{ row.name }}</div>
    </template>
  </AbsurdVirtualTable>
</template>

<script>
import { getUserInfoApi } from "../../api/user";
import AbsurdVirtualTable from "./AbsurdVirtualTable.vue";
export default {
  data() {
    return {
      list: [],
    };
  },
  components: {
    AbsurdVirtualTable,
  },
  methods: {
    getUser() {
      setTimeout(() => {
        getUserInfoApi().then((res) => {
          this.list = [...this.list, ...res.data];
          console.log(this.list);
          this.getUser();
        });
      }, 1000);
    },
  },
  mounted() {
    getUserInfoApi().then((res) => {
      this.list = [...this.list, ...res.data];
      console.log(this.list);
    });
  },
};
</script>

<style scoped>
.scroller {
  height: 100%;
}

.user {
  height: 32%;
  padding: 0 12px;
  display: flex;
  align-items: center;
}
</style>
